package com.example.windowdemo.window.templateWindow;

import android.content.Context;
import android.view.WindowManager;

import com.example.windowdemo.base.BaseWindow;

/**
 * @author: njb
 * @date: 2023/8/3 15:32
 * @desc:
 */
public class MyTemplateWindow extends BaseWindow<String> {
    private Context context;
    public MyTemplateWindow(Context context) {
        super(context);
        this.context = context;
    }

    @Override
    protected void showWindow() {
        WindowManager windowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
        windowManager.addView(contentView, layoutParams);
    }

    @Override
    protected void hideWindow() {
        WindowManager windowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
        windowManager.removeView(contentView);
    }
}
